home *** CD-ROM | disk | FTP | other *** search
- Path: cleveland.Freenet.Edu!gk851
- From: gk851@cleveland.Freenet.Edu (Tim B. Wendt)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Raycasting question
- Date: 5 Jan 1996 05:00:21 GMT
- Organization: Case Western Reserve University, Cleveland OH (USA)
- Message-ID: <4cib95$o2n@madeline.INS.CWRU.Edu>
- NNTP-Posting-Host: kanga.ins.cwru.edu
-
-
- Help, I'm stuck. Here is where I'm at...
-
- * Find the players new position and view angle
- * I traverse my 2D BSP tree and create a sorted polygon (wall) list
- * I rotate the wall's endpoints around such that the center of the
- player's field of view is along the y-axis
- * Cast a ray for each column on the screen
-
- Here's my question. I want to test a ray against each wall in the
- wall list. If it intersects calculate the intersection point (xi,yi)
- between the wall and the ray. Then use yi as the distance for scaling
- the height of the wall. How do I calculate (xi,yi) using only a angle
- (ray) and the endpoints of the wall?
-
- I use an intersection routine in when spliting walls while creating
- the BSP tree but that equation doesn't seem applicable here.
-
- Please post to newsgroup because I'm using a temporary email account
- and I can't always recieve mail. Thanks!
-
- Tim Wendt
- --
- -----------------------------------------------------
- - "Hmmm...beer!" - Homer Simpson -------------------
- ---------------------------------- Tim Wendt --------
- - tim.wendt@daytonoh.ncr.com ----- A1200/030 --------
-